﻿namespace CodePen.Server.Models;

/// <summary>
/// 情话列表
/// </summary>
[SugarTable(nameof(PickContent), "情话列表")]
[SugarIndex("index_categoryid", nameof(CategoryId), OrderByType.Asc)] // 分类ID索引
[SugarIndex("index_status", nameof(IsDisable), OrderByType.Asc)] // 状态索引
[SugarIndex("index_createtime", nameof(CreateTime), OrderByType.Desc)] // 创建时间索引
public class PickContent : EntityBase
{
    /// <summary>
    /// 分类
    /// </summary>
    [SugarColumn(ColumnDescription = "分类", IsNullable = false)]
    public long CategoryId { get; set; }
    /// <summary>
    /// 内容
    /// </summary>
    [SugarColumn(ColumnDescription = "内容", IsNullable = false, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string Content { get; set; }
    /// <summary>
    /// 状态-正常_0、停用_1 
    /// </summary>
    [SugarColumn(ColumnDescription = "是否禁用", IsNullable = true)]
    public YesOrNot? IsDisable { get; set; }

    /// <summary>
    /// 导航属性
    /// </summary>
    [Navigate(NavigateType.ManyToOne, nameof(CategoryId))]
    public PickCategory Category { get; set; }
}
